function Animal(name) {
    this.neme = name;
    this.sleep = function() {
        console.log(this.name + "正在睡觉")
    }
}

Animal.prototype.eat = function(food) {
    console.log(this.name + "正在吃" + food);
}

function Cat(name) {
    Animal.call(this);
    this.name = name || 'mh';
}

var cat = new Cat();


// console.log(Cat.name)
// console.log(Cat.sleep())
// console.log(cat instanceof Animal)
// console.log(cat instanceof Cat)

// for (let a = 0; a < 10; a++) {
//     let b = "";
//     setTimeout(() => {
//         console.log(b + "□")
//     }, 1000);
// }

function Class1() {
    this.showTxt = function(txt) {
        console.log(txt);
    }
    this.lastneme = "ma";
}
//也是一种继承的方式
// Class1.prototype.fullname = function(){

// }

function Class3() {
    Class1.call(this);
    this.firstname = "hu";
    this.fullName = function() {
        return this.lastneme + this.firstname;
    }
}

function Class2() {
    Class1.call(this);
    Class3.call(this);
}

var c2 = new Class2();
c2.showTxt("xx")
console.log(c2.fullName())